package com.timoon.component.panel.jqgrid;

import java.util.HashMap;
import java.util.Map;

public class JqGridParameter {

	private Integer rows;
	private Integer page;
	private Integer startIndex;
	private Integer records;
	private Integer total=1;//总页数
	
	private Map<String,String> map=new HashMap<String,String>();


	public void setBase(Integer rows,Integer page,Integer records){
		this.rows=rows;
		this.page=page;
		this.records=records;
		
		if(records.intValue()<=rows.intValue()){
			total=1;
		}else if(records.intValue()%rows.intValue()>0){
			total=records.intValue()/rows.intValue()+1;
		}else{
			total=records.intValue()/rows.intValue();
		}
		
		this.startIndex=rows*(page-1);
	}
	public void putParam(String key,String value){
		this.map.put(key, value);
	}
	
	public Integer getRows() {
		return rows;
	}
	public void setRows(Integer rows) {
		this.rows = rows;
	}
	public Integer getPage() {
		return page;
	}
	public void setPage(Integer page) {
		this.page = page;
	}
	public Integer getStartIndex() {
		return startIndex;
	}
	public void setStartIndex(Integer startIndex) {
		this.startIndex = startIndex;
	}
	public Map<String, String> getMap() {
		return map;
	}
	public void setMap(Map<String, String> map) {
		this.map = map;
	}
}
